#!/bin/bash
SORTEXEC=$1
PROCS=$2
SIZE=$3
PASSES=$4
OUTFILE=$5
rm -f $OUTFILE
for PUS in $(seq $PROCS)
do
        echo "STARTING==========================================="
        echo "==================================================="
        echo "Executable: $SORTEXEC"
        echo "Output File: $OUTFILE"	
	echo "PUS= $PUS SIZE= ${SIZE}MB, PASSES= $PASSES"
	echo "PUS= $PUS SIZE= ${SIZE}MB, PASSES= $PASSES" >> $OUTFILE
	mpirun -np $PUS $SORTEXEC --mb $SIZE -n $PASSES >> $OUTFILE
	echo "----------------------------------------------" >> $OUTFILE
	echo "----------------------------------------------" >> $OUTFILE
done
